var __extends =
    (this && this.__extends) ||
    (function () {
      var l = function (t, e) {
        return (l =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (l, t) {
              l.__proto__ = t;
            }) ||
          function (l, t) {
            for (var e in t)
              Object.prototype.hasOwnProperty.call(t, e) && (l[e] = t[e]);
          })(t, e);
      };
      return function (t, e) {
        function i() {
          this.constructor = t;
        }
        if ("function" != typeof e && null !== e)
          throw new TypeError(
            "Class extends value " + String(e) + " is not a constructor or null"
          );
        l(t, e),
          (t.prototype =
            null === e
              ? Object.create(e)
              : ((i.prototype = e.prototype), new i()));
      };
    })(),
  FriendEqumentDialog = (function (l) {
    function t() {
      var t = l.call(this) || this;
      return (
        WebSocketService.addListener({
          caller: t,
          code: 1139,
          method: t.onLoadFriEquimentData,
        }),
        t
      );
    }
    return (
      __extends(t, l),
      (t.showFriendsEqumentDialog = function (l) {
        null == this.friEquimentV &&
          ((this.friEquimentV = new t()), (this.friEquimentV.zOrder = 1500)),
          this.friEquimentV.popup(!1),
          (this.friEquimentV.label_friend_title.text = l.name);
        var e = Utils.transform(l.roleType % 10, "roleType"),
          i = Utils.transform(l.sex, "roleSexType");
        (this.friEquimentV.image_user_role1.skin =
          "comp/hreoImg/ws" + this.friEquimentV.setRoleImage(e, i) + "_m.png"),
          WebSocketService.send({ c: 1139, d: { userId: l.id } });
      }),
      (t.prototype.setRoleImage = function (l, t) {
        return "文人" == l
          ? "女" == t
            ? 5
            : 2
          : "武士" == l
          ? "女" == t
            ? 4
            : 1
          : "异师" == l
          ? "女" == t
            ? 6
            : 3
          : 0;
      }),
      (t.prototype.onLoadFriEquimentData = function (l) {
        0 == l.code &&
          ((this.lbl_xianglian1.color = "#f1670c"),
          (this.lbl_huwan1.color = "#f1670c"),
          (this.lbl_toukui1.color = "#f1670c"),
          (this.lbl_zhanxue1.color = "#f1670c"),
          (this.lbl_wuqi1.color = "#f1670c"),
          (this.lbl_kaijia1.color = "#f1670c"),
          l.data.neck && l.data.neck.id
            ? ((this.lbl_xianglian1.text = ""),
              (this.image_hero_xianglian1.skin =
                "arming/" + l.data.neck.p + ".png"),
              (this.label_hero_xianglian1.text = l.data.neck.name),
              (this.label_hero_xianglian_lvl1.text = l.data.neck.lvl),
              (this.label_hero_xianglian_lvl1.borderColor = "#04f904"),
              (this.label_hero_xianglian_lvl1.bgColor = "#474444"))
            : ((this.lbl_xianglian1.text = "项链"),
              (this.label_hero_xianglian1.text = ""),
              (this.lbl_xianglian1.color = "#7d7d7d"),
              (this.image_hero_xianglian1.skin = ""),
              (this.label_hero_xianglian_lvl1.text = ""),
              (this.label_hero_xianglian_lvl1.borderColor = ""),
              (this.label_hero_xianglian_lvl1.bgColor = "")),
          l.data.left_hand && l.data.left_hand.id
            ? ((this.lbl_huwan1.text = ""),
              (this.image_hero_huwan1.skin =
                "arming/" + l.data.left_hand.p + ".png"),
              (this.label_hero_huwan1.text = l.data.left_hand.name),
              (this.label_hero_huwan_lvl1.text = l.data.left_hand.lvl),
              (this.label_hero_huwan_lvl1.borderColor = "#04f904"),
              (this.label_hero_huwan_lvl1.bgColor = "#474444"))
            : ((this.lbl_huwan1.text = "护腕"),
              (this.lbl_huwan1.color = "#7d7d7d"),
              (this.image_hero_huwan1.skin = ""),
              (this.label_hero_huwan1.text = ""),
              (this.label_hero_huwan_lvl1.text = ""),
              (this.label_hero_huwan_lvl1.borderColor = ""),
              (this.label_hero_huwan_lvl1.bgColor = "")),
          l.data.head && l.data.head.id
            ? ((this.lbl_toukui1.text = ""),
              (this.image_hero_toukui1.skin =
                "arming/" + l.data.head.p + ".png"),
              (this.label_hero_toukui1.text = l.data.head.name),
              (this.label_hero_toukui_lvl1.text = l.data.head.lvl),
              (this.label_hero_toukui_lvl1.borderColor = "#04f904"),
              (this.label_hero_toukui_lvl1.bgColor = "#474444"))
            : ((this.lbl_toukui1.text = "头盔"),
              (this.lbl_toukui1.color = "#7d7d7d"),
              (this.image_hero_toukui1.skin = ""),
              (this.label_hero_toukui1.text = ""),
              (this.label_hero_toukui_lvl1.text = ""),
              (this.label_hero_toukui_lvl1.borderColor = ""),
              (this.label_hero_toukui_lvl1.bgColor = "")),
          l.data.foot && l.data.foot.id
            ? ((this.lbl_zhanxue1.text = ""),
              (this.image_hero_zhanxue1.skin =
                "arming/" + l.data.foot.p + ".png"),
              (this.label_hero_zhanxue1.text = l.data.foot.name),
              (this.label_hero_zhanxue_lvl1.text = l.data.foot.lvl),
              (this.label_hero_zhanxue_lvl1.borderColor = "#04f904"),
              (this.label_hero_zhanxue_lvl1.bgColor = "#474444"))
            : ((this.lbl_zhanxue1.text = "战靴"),
              (this.lbl_zhanxue1.color = "#7d7d7d"),
              (this.image_hero_zhanxue1.skin = ""),
              (this.label_hero_zhanxue1.text = ""),
              (this.label_hero_zhanxue_lvl1.text = ""),
              (this.label_hero_zhanxue_lvl1.borderColor = ""),
              (this.label_hero_zhanxue_lvl1.bgColor = "")),
          l.data.right_hand && l.data.right_hand.id
            ? ((this.lbl_wuqi1.text = ""),
              (this.image_hero_wuqi1.skin =
                "arming/" + l.data.right_hand.p + ".png"),
              (this.label_hero_wuqi1.text = l.data.right_hand.name),
              (this.label_hero_wuqi_lvl1.text = l.data.right_hand.lvl),
              (this.label_hero_wuqi_lvl1.borderColor = "#04f904"),
              (this.label_hero_wuqi_lvl1.bgColor = "#474444"))
            : ((this.lbl_wuqi1.text = "武器"),
              (this.lbl_wuqi1.color = "#7d7d7d"),
              (this.image_hero_wuqi1.skin = ""),
              (this.label_hero_wuqi1.text = ""),
              (this.label_hero_wuqi_lvl1.text = ""),
              (this.label_hero_wuqi_lvl1.borderColor = ""),
              (this.label_hero_wuqi_lvl1.bgColor = "")),
          l.data.body && l.data.body.id
            ? ((this.lbl_kaijia1.text = ""),
              (this.image_hero_kaijia1.skin =
                "arming/" + l.data.body.p + ".png"),
              (this.label_hero_kaijia1.text = l.data.body.name),
              (this.label_hero_kaijia_lvl1.text = l.data.body.lvl),
              (this.label_hero_kaijia_lvl1.borderColor = "#04f904"),
              (this.label_hero_kaijia_lvl1.bgColor = "#474444"))
            : ((this.lbl_kaijia1.text = "铠甲"),
              (this.lbl_kaijia1.color = "#7d7d7d"),
              (this.image_hero_kaijia1.skin = ""),
              (this.label_hero_kaijia1.text = ""),
              (this.label_hero_kaijia_lvl1.text = ""),
              (this.label_hero_kaijia_lvl1.borderColor = ""),
              (this.label_hero_kaijia_lvl1.bgColor = "")));
      }),
      t
    );
  })(ui.FriendMomentController.FriendEqumentDialogUI);
